package com.snopy.designPattern.command;

import com.snopy.designPattern.command.impl.BuyStock;
import com.snopy.designPattern.command.impl.SellStock;
import com.snopy.designPattern.command.impl.Stock;
import lombok.extern.slf4j.Slf4j;

/**
 * @author snopy
 * @version 1.0.0
 * @classname CommandPatternDemo
 * @description
 * @email 77912204@qq.com
 * @date 2022/03/04 14:49
 */
@Slf4j
public class CommandPatternDemo {
    public static void main(String[] args) {
        Stock abcStock = new Stock();

        BuyStock buyStock = new BuyStock(abcStock);
        SellStock sellStock = new SellStock(abcStock);
        Broker broker = new Broker();
        buyStock.excute();
        sellStock.excute();
        broker.takeOrder(buyStock);
        broker.takeOrder(sellStock);
        broker.placeOrders();

    }
}
